<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:0px;border:0px">
  <t:datagrid name="dictCategoryList" checkbox="true" fitColumns="true" title="实验类别字典" actionUrl="trainItemController.do?fileDatagrid&ownerId=${ownerId}" idField="id" fit="true" queryMode="group">
   <t:dgCol title="主键"  field="id"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="创建日期"  field="createDate" formatter="yyyy-MM-dd" hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="文件名称"  field="origFileName"   query="false" queryMode="single"  width="120"></t:dgCol>   
   <t:dgCol title="操作" field="opt" width="160"></t:dgCol>   
   <t:dgFunOpt  funname="doload(id)" title="下载"  />   
   </t:datagrid>
  </div>
 </div>
 <script type="text/javascript">
 $(document).ready(function(){
 		//给时间控件加上样式
 			$("#dictGroupListtb").find("input[name='createDate']").attr("class","Wdate").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});
 });
 
function getPeopleCount(v,rec){
	return rec['enterCount']+"/"+rec['maxEnterCount'];
}

function doload(id){
	window.location.href="cms-attach.do?download&ownerId=${ownerId}";
}

function getIsPub(v,rec){
	if(v==0){
		return '未发布';
	}else{
		return '已发布';
	}
}

function pubItem(id){
	$.dialog.confirm('确定要发布培训项目吗？',function(r){
		if(r){
			$.ajax({
				url:"trainItemController.do?pubItem&id="+id,
				success:function(d){
					d = $.parseJSON(d);
					tip(d.msg)
					if(d.success){
						reloadTable();
					}
				}
			});
		}
	});
}

//导出
function ExportXls() {
	JeecgExcelExport("trainItemController.do?exportXls","dictCategoryList");
}

//模板下载
function ExportXlsByT() {
	JeecgExcelExport("trainItemController.do?exportXlsByT","dictCategoryList");
}
 </script>